package Demo16_30.Test21;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by 14229 on 2020/1/26.
 */
public class Test {
    public static void main(String[] args) {
        Map<String,Integer> map = new HashMap<>();
        String s = "柳岩=2100, 张亮=1700, 诸葛亮=1800, 灭绝师太=2600, 东方不败=3800";

        String[] split = s.split(", ");
        for (String s1 : split) {
            String[] sp = s1.split("=");
            RD r = new RD();
            r.setName(sp[0]);
            r.setSalary(Integer.parseInt(sp[1]));
            if (r.getName().equals("柳岩")){
                r.setSalary(r.getSalary()+300);
            }
            map.put(r.getName(),r.getSalary());
        }
        for (String s1 : map.keySet()) {
            System.out.println(s1+" "+map.get(s1));
        }
    }
}
